<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Getdata extends CI_Controller {


	function __construct()
	{
		parent::__construct();

		$this->load->model('admin/dataload','dataload');

	}


	public function admin(){

	}

	public function products(){
		$page = $this->uri->segment(3, 0);
		switch($page){
			case 'categories':
				$this->load->view('admin/managecategory');
				break;
			case 'products':
				$this->load->view('admin/manageproducts');
				break;
			case 'attributes':
				$this->load->view('admin/manageproductattributes');
				break;
		}
	}

	public function cobjects(){
		$page = $this->uri->segment(3, 0);
		switch($page){
			case 'cobjects':
				$this->load->view('admin/mcobjects');
				break;
			case 'cattrib':
				$this->load->view('admin/mcattrib');
				break;
			case 'cdata':
				$this->load->view('admin/mcdata');
				break;
		}
	}
	
	public function workflow(){
		$page = $this->uri->segment(3, 0);
		switch($page){
			case 'allworkflows':
				$result=$this->dataload->fetchAllWorkFlows();
				echo json_encode($result);
				break;
			case 'workflow':
				$result=$this->dataload->fetchWorkflowData();
				echo json_encode($result);
				break;
		}
	}

}